import JsEncrypt from 'jsencrypt'
import { Base64 } from 'js-base64';
/*const publicKey = '-----BEGIN PUBLIC KEY-----' +
  'MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDlOJu6TyygqxfWT7eLtGDwajtN' +
  'FOb9I5XRb6khyfD1Yt3YiCgQWMNW649887VGJiGr/L5i2osbl8C9+WJTeucF+S76' +
  'xFxdU6jE0NQ+Z+zEdhUTooNRaY5nZiu5PgDB0ED/ZKBUSLKL7eibMxZtMlUDHjm4' +
  'gwQco1KRMDSmXSMkDwIDAQAB' +
  '-----END PUBLIC KEY-----';

const privateKey = '-----BEGIN RSA PRIVATE  KEY-----' +
  'MIICXQIBAAKBgQDlOJu6TyygqxfWT7eLtGDwajtNFOb9I5XRb6khyfD1Yt3YiCgQ' +
  'WMNW649887VGJiGr/L5i2osbl8C9+WJTeucF+S76xFxdU6jE0NQ+Z+zEdhUTooNR' +
  'aY5nZiu5PgDB0ED/ZKBUSLKL7eibMxZtMlUDHjm4gwQco1KRMDSmXSMkDwIDAQAB' +
  'AoGAfY9LpnuWK5Bs50UVep5c93SJdUi82u7yMx4iHFMc/Z2hfenfYEzu+57fI4fv' +
  'xTQ//5DbzRR/XKb8ulNv6+CHyPF31xk7YOBfkGI8qjLoq06V+FyBfDSwL8KbLyeH' +
  'm7KUZnLNQbk8yGLzB3iYKkRHlmUanQGaNMIJziWOkN+N9dECQQD0ONYRNZeuM8zd' +
  '8XJTSdcIX4a3gy3GGCJxOzv16XHxD03GW6UNLmfPwenKu+cdrQeaqEixrCejXdAF' +
  'z/7+BSMpAkEA8EaSOeP5Xr3ZrbiKzi6TGMwHMvC7HdJxaBJbVRfApFrE0/mPwmP5' +
  'rN7QwjrMY+0+AbXcm8mRQyQ1+IGEembsdwJBAN6az8Rv7QnD/YBvi52POIlRSSIM' +
  'V7SwWvSK4WSMnGb1ZBbhgdg57DXaspcwHsFV7hByQ5BvMtIduHcT14ECfcECQATe' +
  'aTgjFnqE/lQ22Rk0eGaYO80cc643BXVGafNfd9fcvwBMnk0iGX0XRsOozVt5Azil' +
  'psLBYuApa66NcVHJpCECQQDTjI2AQhFc1yRnCU/YgDnSpJVm1nASoRUnU8Jfm3Oz' +
  'uku7JUXcVpt08DFSceCEX9unCuMcT72rAQlLpdZir876' +
  '-----END RSA PRIVATE KEY-----';*/
const publicKey = Base64.decode("LS0tLS1CRUdJTiBQVUJMSUMgS0VZLS0tLS1NSUdmTUEwR0NTcUdTSWIzRFFFQkFRVUFBNEdOQURDQmlRS0JnUURsT0p1NlR5eWdxeGZXVDdlTHRHRHdhanRORk9iOUk1WFJiNmtoeWZEMVl0M1lpQ2dRV01OVzY0OTg4N1ZHSmlHci9MNWkyb3NibDhDOStXSlRldWNGK1M3NnhGeGRVNmpFME5RK1orekVkaFVUb29OUmFZNW5aaXU1UGdEQjBFRC9aS0JVU0xLTDdlaWJNeFp0TWxVREhqbTRnd1FjbzFLUk1EU21YU01rRHdJREFRQUItLS0tLUVORCBQVUJMSUMgS0VZLS0tLS0=")
const privateKey = Base64.decode("LS0tLS1CRUdJTiBSU0EgUFJJVkFURSAgS0VZLS0tLS1NSUlDWFFJQkFBS0JnUURsT0p1NlR5eWdxeGZXVDdlTHRHRHdhanRORk9iOUk1WFJiNmtoeWZEMVl0M1lpQ2dRV01OVzY0OTg4N1ZHSmlHci9MNWkyb3NibDhDOStXSlRldWNGK1M3NnhGeGRVNmpFME5RK1orekVkaFVUb29OUmFZNW5aaXU1UGdEQjBFRC9aS0JVU0xLTDdlaWJNeFp0TWxVREhqbTRnd1FjbzFLUk1EU21YU01rRHdJREFRQUJBb0dBZlk5THBudVdLNUJzNTBVVmVwNWM5M1NKZFVpODJ1N3lNeDRpSEZNYy9aMmhmZW5mWUV6dSs1N2ZJNGZ2eFRRLy81RGJ6UlIvWEtiOHVsTnY2K0NIeVBGMzF4azdZT0Jma0dJOHFqTG9xMDZWK0Z5QmZEU3dMOEtiTHllSG03S1VabkxOUWJrOHlHTHpCM2lZS2tSSGxtVWFuUUdhTk1JSnppV09rTitOOWRFQ1FRRDBPTllSTlpldU04emQ4WEpUU2RjSVg0YTNneTNHR0NKeE96djE2WEh4RDAzR1c2VU5MbWZQd2VuS3UrY2RyUWVhcUVpeHJDZWpYZEFGei83K0JTTXBBa0VBOEVhU09lUDVYcjNacmJpS3ppNlRHTXdITXZDN0hkSnhhQkpiVlJmQXBGckUwL21Qd21QNXJON1F3anJNWSswK0FiWGNtOG1SUXlRMStJR0VlbWJzZHdKQkFONmF6OFJ2N1FuRC9ZQnZpNTJQT0lsUlNTSU1WN1N3V3ZTSzRXU01uR2IxWkJiaGdkZzU3RFhhc3Bjd0hzRlY3aEJ5UTVCdk10SWR1SGNUMTRFQ2ZjRUNRQVRlYVRnakZucUUvbFEyMlJrMGVHYVlPODBjYzY0M0JYVkdhZk5mZDlmY3Z3Qk1uazBpR1gwWFJzT296VnQ1QXppbHBzTEJZdUFwYTY2TmNWSEpwQ0VDUVFEVGpJMkFRaEZjMXlSbkNVL1lnRG5TcEpWbTFuQVNvUlVuVThKZm0zT3p1a3U3SlVYY1ZwdDA4REZTY2VDRVg5dW5DdU1jVDcyckFRbExwZFppcjg3Ni0tLS0tRU5EIFJTQSBQUklWQVRFIEtFWS0tLS0t")
const encrypt = new JsEncrypt()
encrypt.setPublicKey(publicKey);
// Vue.prototype.$encrypt = encrypt;
const decrypt = new JsEncrypt()
decrypt.setPrivateKey(privateKey);
const JSencrypt = {
  encrypt:(str)=>{
    return encrypt.encrypt(str)
  },
  decrypt:(str)=>{
    return decrypt.decrypt(str)
  }
}
export default JSencrypt
